package com.jlkf.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.jlkf.pojo.TblProblem;
import com.jlkf.service.ProblemService;

@Controller
@RequestMapping("/problem")
public class ProblemController {
	
	@Autowired
	private ProblemService problemServie;
	
	/**
     * pc端技术提问列表
     */
	@ResponseBody
	@RequestMapping(value = "/selectProblemList",method = RequestMethod.POST)
	public Object selectProblemList(Integer userid,Integer courseid){
		return problemServie.selectProblemList(userid,courseid);
	}
	
	/**
     * pc端提交技术问答
     */
	@ResponseBody
	@RequestMapping(value = "/insertSelective",method = RequestMethod.POST)
	public Object insertSelective(TblProblem record) throws Exception{
		return problemServie.insertSelective(record);
	}
	
	/**
	 * 我的问答
	 */
	@RequestMapping("getMyProblem")
	@ResponseBody
	public Object getMyProblem(Integer userId,Integer type,Integer pageNumber,Integer pageSize){
		return problemServie.getMyProblem(userId, type, pageNumber, pageSize);
	}
	
	/**
	 * 删除我的问答
	 */
	@RequestMapping("deleteProblem")
	@ResponseBody
	public Object deleteProblem(Integer id){
		return problemServie.deleteProblem(id);
	}
	
	/**
	 * 意见反馈
	 */
	@ResponseBody
	@RequestMapping(value = "/insertFeedBack",method = RequestMethod.POST)
	public Object insertFeedBack(@RequestBody String json){
		return problemServie.insertFeedBack(json);
	}
}
